package collect.collection.set;

import java.util.HashSet;

public class TestHashSet {
    public static void main(String[] args) {
        HashSet<Student> set = new HashSet<>();
        Student s1 = new Student("张三", 23);
        Student s2 = new Student("李四", 24);
        Student s3 = new Student("张三", 23);
        set.add(s1);
        boolean result = set.add(s2);
        set.add(s3);
        System.out.println(result);
        System.out.println(set);
    }
}
